#ifndef _MEDIA_DMS_DATABASE_H_
#define _MEDIA_DMS_DATABASE_H_
#include "PltDatabaseMediaServer.h"
////////////////////////////////////////////////////////////////
//-------------------------------
//   file server delegate media
//-------------------------------

#include "PltDatabaseMediaServer.h"



class PLT_DatabaseMediaServerControlDelegate_android: public PLT_MediaServerControlDelegate
{
public:
    PLT_DatabaseMediaServerControlDelegate_android() {}
    virtual ~PLT_DatabaseMediaServerControlDelegate_android() {}
    
    virtual NPT_Result OnControlPointSearch(NPT_IpAddress& ipaddr,NPT_String user_agent, bool & isClientAllowed);
};
class PLT_DatabaseMediaServerResponseDelegate_android: public PLT_DatabaseMediaServerResponseDelegate
{
public:
	PLT_DatabaseMediaServerResponseDelegate_android() {}
	virtual ~PLT_DatabaseMediaServerResponseDelegate_android() {}
	
	//virtual NPT_Result OnProcessFileRequest(NPT_String mediafile, bool isdirecttv);

	virtual int mediaRequest(const MediaInfo& requestMedia,RequestResultMediaInfo& result);
	virtual int  getFolderChildrenCount(int mediaType); 
	virtual int handleBrowse(const BrowseArgs& browseArgs,BrowseOrSearchResult& result);
	virtual int handleSearch(const SearchArgs& searchArgs,BrowseOrSearchResult& result);
	virtual int onBookOrRecordEvent(PLT_ActionReference& action,const BookOrRecordEventInfo& bookOrRecordEventInfo,ActionMessage& result);
};
extern NPT_Result onControlPointSearch(NPT_IpAddress& ipaddr,NPT_String user_agent, bool & isClientAllowed);
extern int mediaRequestResult(const MediaInfo& requestMedia,RequestResultMediaInfo& result);
extern int getFolderChildrenCountResult(int mediaType);
extern int handleBrowseDms(const BrowseArgs& browseArgs,BrowseOrSearchResult& result);
extern int handleSearchDms(const SearchArgs& searchArgs,BrowseOrSearchResult& result);
extern NPT_Result onBookOrRecordEventCallApp(
						PLT_ActionReference&			action,
						const BookOrRecordEventInfo& 	bookOrRecordEvent,
						ActionMessage& 					result);

int PltDatabaseDMSSetup(const char * name,int portnum,const char * uid_tail);
void PltDatabaseDMSStop();
void setDefaultAllowSettingDMSBaseDataBase(bool isAllowed);
void setIPControlListAllowDMSBaseDataBase(NPT_Map<NPT_String, bool> list);
PLT_DatabaseMediaServer* getMediaServerBaseDataBase();
#endif